package com.xaicode.template.jaeger.service;

import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Locker
 * @date 2021/8/9 0009 15:05
 */
@Service
@Slf4j
public class ConsumerServiceImpl implements IConsumerService {

    @Override
    @KafkaListener(topics = "aaa")
    public void receive(List<ConsumerRecord<?, ?>> records) {
        records.forEach(record -> {
            log.info(record.toString());
        });
    }
}
